function _openDialogSellerInfo($user_id){
	jQuery.post(BASE_URL+"admin/dataman/seller/user_information",{user_id:$user_id},function(response){
		jQuery('#dialog').html(response);
		jQuery('#dialog').dialog(
			{
				 width: 950,
				 resizable: true,
				 height:600,
				 title: 'Seller Information' 
			}
		);
	});
}

function _openDialogBuyerInfo($user_id){
	jQuery.post(BASE_URL+"admin/dataman/buyer/user_information",{user_id:$user_id},function(response){
		jQuery('#dialog').html(response);
		jQuery('#dialog').dialog(
			{
				 width: 950,
				 resizable: true,
				 height:600,
				 title: 'Buyer Information' 
			}
		);
	});
}

function _openDialogShowInfo($show_id){
	jQuery.post(BASE_URL+"admin/dataman/show/show_information",{show_id:$show_id},function(response){
		jQuery('#dialog').html(response);
		jQuery('#dialog').dialog(
			{
				 width: 950,
				 resizable: true,
				 height:600,
				 title: 'Show Information' 
			}
		);
	});
}

function _openDialogBidInfo($bid_id){
	jQuery.post(BASE_URL+"admin/dataman/show/bid_information",{bid_id:$bid_id},function(response){
		jQuery('#dialog').html(response);
		jQuery('#dialog').dialog(
			{
				 width: 950,
				 resizable: true,
				 height:600,
				 title: 'Bid Information' 
			}
		);
	});
}

function change_pay_status($value, $show_id){
	jQuery.post(BASE_URL+"admin/dataman/bid/change_pay_status",{show_id:$show_id,status:$value},function(response){
		window.location.reload();
	});
}

function changeAct(action){
	jQuery('#action').attr('value', action);
	jQuery('#email_compose').submit();
}

jQuery(document).ready(function() {
	jQuery("#email_compose").live("submit",function(e){
		e.preventDefault(); // <-- important
		var options = { 
			beforeSubmit:  validateB4Submit,   
			success:       processAfterResponding   
		};	
		jQuery(this).ajaxSubmit(options);
		return false;
	});
	
});	


function processAfterResponding(responseText, statusText, xhr, $form) {	
	document.location = BASE_URI+'admin/dataman/bid/email/?show_id='+jQuery('#show_id').val()+'&bid_id='+jQuery('#bid_id').val();
}

function validateB4Submit(formData, jqForm, options){
	return true;
}
